package com.duobaoyu.dby.supply.common.biz.dto.invoice;

import com.duobaoyu.dby.common.core.validator.groups.Add;
import com.duobaoyu.dby.common.core.validator.groups.Edit;
import com.duobaoyu.dby.common.core.validator.phone.Phone;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author jz
 * @version 1.0
 * @date 2022/6/5 09:52
 */
@Data
public class InvoiceSettingDTO implements Serializable {

	private static final long serialVersionUID = -3214078875032078138L;

	@NotNull(message = "id不能为空",groups = {Edit.class})
	private Long id;

	/**
	 * 渠道code
	 */
	@NotBlank(message = "渠道code不能为空",groups = {Add.class, Edit.class})
	private String channelCodes;

	/**
	 * 发票抬头
	 */
	@NotBlank(message = "发票抬头不能为空",groups = {Add.class, Edit.class})
	@Length(min = 1, max = 20, message = "发票抬头20字以内",groups = {Add.class, Edit.class})
	private String invoiceCompanyName;

	/**
	 * 收票人姓名
	 */
	@NotBlank(message = "收票人姓名不能为空",groups = {Add.class, Edit.class})
	@Length(min = 1, max = 10, message = "收票人姓名10字以内",groups = {Add.class, Edit.class})
	private String invoiceName;

	/**
	 * 收票人手机号
	 */
	@NotBlank(message = "收票人手机号不能为空",groups = {Add.class, Edit.class})
	@Phone(groups = {Add.class, Edit.class})
	private String invoicePhone;

	/**
	 * 收票人地址省
	 */
	@NotBlank(message = "收票人地址省不能为空",groups = {Add.class, Edit.class})
	private String invoiceProvinceCode;

	/**
	 * 收票人地址城市
	 */
	@NotBlank(message = "收票人地址城市不能为空",groups = {Add.class, Edit.class})
	private String invoiceCityCode;

	/**
	 * 收票人地址区县
	 */
	@NotBlank(message = "收票人地址区县不能为空",groups = {Add.class, Edit.class})
	private String invoiceCountyCode;

	/**
	 * 收票人地址乡镇
	 */
	private String invoiceTownCode;

	/**
	 * 收票人地址明细
	 */
	@NotBlank(message = "收票人地址明细不能为空",groups = {Add.class, Edit.class})
	@Length(min = 1, max = 50, message = "收票人地址明细50字以内",groups = {Add.class, Edit.class})
	private String invoiceAddress;

	/**
	 * 企业注册名称
	 */
	//@NotBlank(message = "企业注册名称不能为空")
	//@Length(min = 1, max = 50, message = "企业注册名称不能为空50字以内")
	private String invoiceRegCompanyName;

	/**
	 * 纳税人编码
	 */

	@NotBlank(message = "纳税人编码不能为空",groups = {Add.class, Edit.class})
	@Pattern(regexp = "[0-9A-Z]{18}", message = "纳税人编码格式不正确",groups = {Add.class, Edit.class})
	private String invoiceTaxpayerCode;

	/**
	 * 企业注册地址
	 */
	@NotBlank(message = "企业注册地址不能为空",groups = {Add.class, Edit.class})
	@Length(min = 1, max = 200, message = "企业注册地址应200字以内",groups = {Add.class, Edit.class})
	private String invoiceRegAddress;

	/**
	 * 企业注册电话
	 */
	@NotBlank(message = "企业注册电话不能为空",groups = {Add.class, Edit.class})
	@Pattern(regexp = "^(\\d{3,4}-)?\\d{6,8}$", message = "企业注册电话格式不正确",groups = {Add.class, Edit.class})
	private String invoiceRegPhone;

	/**
	 * 企业开户银行营业点
	 */
	@NotBlank(message = "企业开户银行营业点不能为空",groups = {Add.class, Edit.class})
	@Pattern(regexp = "[\u4e00-\u9fa5]{1,50}", message = "开户银行应是50以内的纯汉字",groups = {Add.class, Edit.class})
	private String invoiceRegBank;

	/**
	 * 企业开户银行账号
	 */
	@NotBlank(message = "企业开户银行账号不能为空",groups = {Add.class, Edit.class})
	@Pattern(regexp = "\\d{12,19}", message = "企业开户银行账号应是12到19位纯数字",groups = {Add.class, Edit.class})
	private String invoiceRegBankAccount;

}
